package com.demo.listener;

import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 通过指定泛型类型监听单一事件
 */
public class MyApplicationEnvironmentPreparedListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {

    /**
     * @param event
     */
    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
            onApplicationEnvironmentPreparedEvent(event);
    }

    public void onApplicationEnvironmentPreparedEvent(ApplicationEnvironmentPreparedEvent event) {
        System.out.println("---------------- this is MyApplicationEnvironmentPreparedListener onApplicationEnvironmentPreparedEvent");
    }
}
